package com.atguigu.serviceedu.controller;


import com.atguigu.commonutils.R;
import com.atguigu.serviceedu.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * <p>
 * 讲师 前端控制器
 * </p>
 *
 * @author xuan
 * @since 2020-04-06
 */
//@CrossOrigin
@RestController
@Api(description="登录")
@RequestMapping("/edu/user")
public class LoginController {

    @Autowired
    private EduTeacherService eduTeacherService;

    @ApiOperation(value = "登录")
    @PostMapping("login")
    public R userLogin(String username,String password){
        return R.ok().data("token","admin");
    }


    @ApiOperation(value = "验证登录")
    @GetMapping("info")
    public R userLogin(String token){
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }


}
